var SubsidiaryMaterialDataModel = function (materialList, type) {
  BaseModel.call(this);

  var self = this;
  var fn = {
    initData: function (materialList, type) {
      var materials = [];
      for (var i = 0; i < materialList.length; i++) {
        var material = materialList[i];
        var lineNo = material.lineNo;
        material = new ProduceMaterialDataModel(material, 'subsidiary', type);
        material.lineNo = lineNo;
        materials.push(material);
      }
      self.materialList = materials;
    }
  };

  this.getObject = function (option) {
    var materialList = this.materialList;
    var materials = [];
    for (var i = 0; i < materialList.length; i++) {
      var material = materialList[i];
      var lineNo = material.lineNo;
      material = material.getObject(option);
      material.lineNo = lineNo;
      materials.push(material);
    }
    return materials;
  };

  fn.initData(materialList, type);
};
